﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/themes/icon.css" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/themes/default/easyui.css" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/demo.css" />
<script src="${pageContext.request.contextPath}/script/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/script/jquery.easyui.min.js"></script>
<script src="${pageContext.request.contextPath}/script/easyui-lang-zh_CN.js"></script>
<title>注册</title>

<style type="text/css">

body{margin:0;padding:0}

.STYLE1 {
	color: #ffffff;
	font-size: 12px;
}
.STYLE4 {
	color: #8da8c3;
	font-size: 12px;
}
.STYLE6 {
	font-size: 12px;
	color: #5593ce;
}

</style>

</head>

<body>
<table width="100%" height="1024" border="0" align="center" cellpadding="0" cellspacing="0"  style="margin:0px; padding:0px">
  <tr>
    <td height="594"  align="center" valign="top" background="${pageContext.request.contextPath}/images/bj.gif">
	<table width="465" height="414" border="0" align="center" cellpadding="0" cellspacing="0" >
      <tr>
        <td  height="152" colspan="3" valign="bottom"><img src="${pageContext.request.contextPath}/images/toplogin.png" width="460" height="155" /></td>
      </tr>
      <tr>
        <td width="15" height="262" background="${pageContext.request.contextPath}/images/bj1.gif">&nbsp;</td>
        <td width="420" valign="middle" background="${pageContext.request.contextPath}/images/bj2.gif">
	<form onsubmit="return check();">
		<table width="100%" height="170" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="31%" align="right"><span class="STYLE1">用户名：</span></td>
              <td colspan="3" align="left">
              <label>
                <input id="username" name="username" type="text" class="easyui-textbox" data-options="required:true,missingMessage:'用户名必填！长度为3~5位数！' " />
              </label>
              </td>
            </tr>
            <tr>
              <td align="right"><span class="STYLE1">密&emsp;码：</span></td>
              <td colspan="3" align="left">
              <label>
                <input id="password"  name="password" type="text" class="easyui-textbox" data-options="required:true,missingMessage:'密码必填！长度为6~8位数！' " />
              </label>
              </td>
            </tr>
             <tr>
              <td align="right"><span class="STYLE1">确认密码：</span></td>
              <td colspan="3" align="left"><label>
                <input id="password2" name="password2" type="text" class="easyui-textbox" data-options="required:true,missingMessage:'确认密码必填!' " />
              </label></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td width="15%" valign="top"><p class="STYLE4">&nbsp;</p>                </td>
              <td width="20%" align="right" valign="middle">
              	<a href="${pageContext.request.contextPath}/login/login" ><img src="${pageContext.request.contextPath}/images/fhdl.jpg"/></a>
              	<br />
                  <br />
              <td width="34%" height="55" align="left"> 
			   <!-- <input type="button" onclick="zhuce()" style="width:76px; height:22px;" value="注册"/> -->
			    <a type="button" class="easyui-linkbutton" iconCls="icon-ok" onclick="zhuce()" />注册</a>
              </td>
            </tr>
        </table>
	</form>		
	</td>
        <td width="13" background="${pageContext.request.contextPath}/images/bj3.gif">&nbsp;</td>
      </tr>
    </table>
	<table width="100%" height="9%" border="0" cellpadding="0" cellspacing="0">

    </table>
	<br />
	<table width="100%" height="4%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="4%" align="center" valign="middle"><span class="STYLE6">版权所有：Hcx天行猫速运 <br />
              <br />
          <a href="http://www.hcx520.com"><span>友情链接:www.hcx520.com</span></a></td>
      </tr>
    </table></td>
  </tr>
</table>

<script>
			function zhuce(){
				var username = $("#username").val();
				var password = $("#password").val();
				var password2= $("#password2").val();
				$.ajax({
					url:"${pageContext.request.contextPath}/login/zhuce",
					type:"POST",				
					data:{
						"username":username,
						"password":password,
						"password2":password2,
						},
					dataType:"json",
					success:function(data){
						if(password != password2){
						 	alert("两次密码输入不一样,请重新输入！！！");
						}
						else{
       				 		alert("请牢记用户名与密码！！！");
							window.location.href="${pageContext.request.contextPath}/login/login";
						}
					},
					error:function(){
					if(username.length<3 || username.length>5){
						alert("用户名格式错了！");
					}
					if(password.length<6 || password.length>8){
						alert("密码格式错了！");
					}else
						alert("用户名已被占用，注册失败！！！");
					}
				});
			}
</script>
</body>
</html>
